﻿
  
  
using HumanWorkflow.Framework;
using HumanWorkflow.SemanticModel;

namespace OrderWorkflow
{
	public partial class OrderWorkflowWithFramework : HumanWorkflowEngine
	{      		
		public static HumanWorkflowSemanticModel InitializeSemanticModel()
		{
			HumanWorkflowSemanticModel semanticModel = new HumanWorkflowSemanticModel();

			semanticModel.AddStep(new ManualStep {Name = "ConcordeCustomerData", Role = "CustomerCare"}); 
			semanticModel.AddStep(new ManualStep {Name = "CheckPossibleDiscounts", Role = "CustomerCare"}); 
			semanticModel.AddStep(new AutomaticStep {Name = "SendNotificationEmailToCustomer"}); 		
			semanticModel.AddStep(new ManualStep {Name = "ShipItems", Role = "Inventory"}); 
			semanticModel.AddStep(new ManualStep {Name = "OrderMissingItems", Role = "OrderHandling"}); 
			semanticModel.AddStep(new ManualStep {Name = "WaitForItemsToArrive", Role = "OrderHandling"}); 
			semanticModel.AddStep(new FinalStep {Name = "Finish"}); 		
			semanticModel.AddStep(new InitialStep {Name = "Start"}); 		
			semanticModel.AddStep(new DecisionStep {Name = "AreAllItemsOnStock"}); 		

			semanticModel.AddTransition("Start", "ConcordeCustomerData", "Start");
			semanticModel.AddTransition("ConcordeCustomerData", "CheckPossibleDiscounts", "ConcordanceReady");
			semanticModel.AddTransition("CheckPossibleDiscounts", "AreAllItemsOnStock", "DiscountCheckReady");
			semanticModel.AddTransition("AreAllItemsOnStock", "SendNotificationEmailToCustomer", "ItemsAreMissing");
			semanticModel.AddTransition("AreAllItemsOnStock", "ShipItems", "ItemsAreAvailable");
			semanticModel.AddTransition("SendNotificationEmailToCustomer", "OrderMissingItems", "EmailSent");
			semanticModel.AddTransition("ShipItems", "Finish", "ItemsShipped");
			semanticModel.AddTransition("OrderMissingItems", "WaitForItemsToArrive", "MissingItemsOrderDone");
			semanticModel.AddTransition("WaitForItemsToArrive", "ShipItems", "MissingItemsArrived");

			return semanticModel;
		}
	}

 	public partial class  OrderWorkflowWithFrameworkSteps
    {
        public const string ConcordeCustomerDataManualStep = "ConcordeCustomerData";
        public const string CheckPossibleDiscountsManualStep = "CheckPossibleDiscounts";
        public const string SendNotificationEmailToCustomerAutomaticStep = "SendNotificationEmailToCustomer";
        public const string ShipItemsManualStep = "ShipItems";
        public const string OrderMissingItemsManualStep = "OrderMissingItems";
        public const string WaitForItemsToArriveManualStep = "WaitForItemsToArrive";
        public const string FinishFinalStep = "Finish";
        public const string StartInitialStep = "Start";
        public const string AreAllItemsOnStockDecisionStep = "AreAllItemsOnStock";
    
    }	

	public partial class  OrderWorkflowWithFrameworkRoles
    {
        public const string CustomerCare = "CustomerCare";
        public const string Inventory = "Inventory";
        public const string OrderHandling = "OrderHandling";
    
    }

	public partial class  OrderWorkflowWithFrameworkTransitions
    {
		public const string Start = "Start";
		public const string ConcordanceReady = "ConcordanceReady";
		public const string DiscountCheckReady = "DiscountCheckReady";
		public const string ItemsAreMissing = "ItemsAreMissing";
		public const string ItemsAreAvailable = "ItemsAreAvailable";
		public const string EmailSent = "EmailSent";
		public const string ItemsShipped = "ItemsShipped";
		public const string MissingItemsOrderDone = "MissingItemsOrderDone";
		public const string MissingItemsArrived = "MissingItemsArrived";
    
    }	
}
	
